Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix basic auth credentials in --extra-index-urls when using multiple credentials for same domain #10033

Merged
merged 8 commits into from
Jun 11, 2021

Conversation

snook92
Copy link

@snook92 snook92 commented May 31, 2021

Fix proposal for issue that is pending. Close #3931.

@uranusjr
Copy link
Member

If self._get_new_password() is always called, is self.password still needed?

@snook92
Copy link
Author

snook92 commented May 31, 2021

I think this is useful in case of 401 where url credentials are not (directly) available (like url forwarding by the server to a specific file). Also, to be honest, as this is my first PR here, I've tried to minimize the scope of my change. Feel free to improve it if anything. thank you

@uranusjr
Copy link
Member

Yeah, you’re right, handle_401 writes to this dict. With this patch, self.passwords will serve as a fallback when self._get_new_credentials() returns (None, None).

The logic change looks correct to me, although some refactors would be best; we can get to that later. First you’ll need to fix the tests.

@snook92
Copy link
Author

snook92 commented May 31, 2021

Thank you for the feedback. I will fix the tests soon.

src/pip/_internal/network/auth.py Outdated Show resolved Hide resolved
tests/unit/test_network_auth.py Show resolved Hide resolved
news/3931.bugfix.rst Outdated Show resolved Hide resolved
src/pip/_internal/network/auth.py Show resolved Hide resolved
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming tests pass.

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is restructuredText so double backticks are needed.

news/3931.bugfix.rst Outdated Show resolved Hide resolved
@snook92
Copy link
Author

snook92 commented Jun 3, 2021

thank you for your helpful review @uranusjr

@snook92
Copy link
Author

snook92 commented Jun 7, 2021

Changes approved and tests are passing. Is it ready to be merged ?

@jvenant
Copy link

jvenant commented Jun 10, 2021

That is a very interesting feature. It would help us too
And drastically improve the usage of git repository in pip.

Any idea of when it will be merged ?

Thank you

@pradyunsg pradyunsg merged commit a90dd11 into pypa:main Jun 11, 2021
@pradyunsg
Copy link
Member

Any idea of when it will be merged ?

Whenever one of the maintainers (who are almost exclusively volunteers) come around to taking a look at this.

@pradyunsg
Copy link
Member

Thanks for the PR @snook92 and for the detailed review @uranusjr! ^>^

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic auth credentials in --extra-index-urls are not used when specifying multiple under the same domain
4 participants